<!DOCTYPE html>
<html>
<#include "../head.html">
    <body>
    <table class="mc">
        <tr>
            <td class="mc-l">
                <!--左侧导航---{-->
                <div id="navPanelContainer">
                    <div class="system-logo cd"></div>
                    <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                        <!--管理员信息---}-->
                        <div class="nav-wrap">
                            <#include "left.html">
                        </div>
                </div>
                <!--左侧导航---}-->
            </td>
            <td class="mc-m">
                <div class="navToggle"></div>
            </td>
            <td class="mc-r">
                <!--顶部导航---{-->
                <#include "../topNav.html">
                    <!--顶部导航---}-->

                    <!--面包屑导航---{-->
                    <#assign moduleName="新增文章">
                        <#include "banner.html">
                            <!--面包屑导航---}-->

                                <!--工具栏--{-->
                                <div id="toolbar" class="clearfix">
                                    <input type="button" class="input-button return" value="返回" onclick="javascript:location.href='showArticle.html'">
 
                                </div>
                                <!--工具栏--}-->

                                <div id="main" class="w750 clearfix">

                                    <form name="form1" method="post" action="" onsubmit="return check_form();" enctype="multipart/form-data" >
                                        <div class="valBox">
                                            <div class="top">
                                                <strong>新增文章</strong>
                                            </div>
                                            <div class="clearfix">
                                                <ul class="title-v edit">
                                                    <li>
                                                        <div class="title">标题：</div>
                                                        <div class="v">
                                                            <input type="text" name="name"  class="input_border" value="" size="30" />
                                                            <label><input type="checkbox" onclick="jump_url()"  name="is_jump" value="1"/> 跳转</label>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">栏目英文标识：</div>
                                                        <div class="v">
                                                            <input type="text" name="ename"  class="input_border" value="" size="30" />
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">定义属性：</div>
                                                        <div class="v">
                                               <label> <input type='checkbox' name='flags' value='t' >推荐</label>
                                                   <label><input type='checkbox' name='flags' value='h' >头条</label>
                                                       <label><input type='checkbox' name='flags' value='f' >幻灯片</label>
                                                        </div>
                                                    </li>
                                                    <li style="display:none" id="jump_url">
                                                        <div class="title">跳转网址：</div>
                                                        <div class="v">
                                                            <input type="text" name="jumpurl"  class="input_border" value="" size="30" />
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">所属栏目：</div>
                                                        <div class="v">
                                                            <@siteDirect name="site_id" ></@siteDirect>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">文章来源：</div>
                                                        <div class="v">
                                                            <input type="text" name="source"  class="input_border" value="" size="30" />
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">作者：</div>
                                                        <div class="v">
                                                            <input type="text" name="author"  class="input_border" value="" size="30" />

                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">发布时间：</div>
                                                        <div class="v">
                                                            <input type="text" name="publish"  class="input_border js-datetime" value="${dateformat(dateformat("now"))}" size="30" readonly=""/>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">状态：</div>
                                                        <div class="v">
                                                            <label><input type="radio" name="status" value="0"  checked="checked"/>隐藏</label>
                                                                <label><input type="radio" name="status" value="1"  checked="checked"/>显示</label>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">排序：</div>
                                                        <div class="v">
                                                            <input type="text" name="order"  class="input_border" value="10" size="10" />
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">内容简介：</div>
                                                        <div class="v">
                                                            <textarea name="summary" cols="45" rows="5"></textarea>
                                                        </div>
                                                    </li>
                                         <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/kindeditor-min.js"></script>
				<script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/lang/zh_CN.js"></script>
                                                    <li>
                                                        <div class="title">内容：</div>
                                                        <div class="v">
                                                            <textarea name="content" id="content" style="width:500px;height:200px;" class="ckeditor"></textarea>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="title">上传文件：</div>
                                                        <div class="v">
                                                            <input type='file' name='files' value='' size='20' id='files'>
                                                        </div>
                                                    </li>
			                               
                                                </ul>
                                            </div>

                                        </div>

                                    <div id="bottomToolbar" class="clearfix">
                                        <input type="hidden"  name="actionType" value="addArticle" />
                                        <input class="input-button post" type="submit"  name="submit" value="提交" />
                                        <input class="input-button reset" type="reset"  name="reset" value="重置" />
                                    </div>
                            </form>
                            </div>
                            <script>
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
					uploadJson : '${webroot}/editorUploadImg.html',
					fileManagerJson : '${webroot}/editorUploadImg.html',
					allowFileManager : true,
					items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
					       'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
					       'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
					       'superscript', '|', 'selectall', '-',
					       'title', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
					       'italic', 'underline', 'strikethrough', 'removeformat', '|', 
					       'image','advtable', 'hr', 'emoticons', 'link', 'unlink']
				});
			});
			function check_form(){
				 var frm = document.forms['form1'];
				 var name = frm.elements['name'].value;
				 var content = frm.elements['content'].value;
				 var errorMsg = '';
				  if (name.length == 0 ) {
					errorMsg += '标题必须填写' + '\n';
				  }
				  
				  if (errorMsg.length > 0){
					alert(errorMsg); return false;
				  } else{  
					return true;
				  }
			}
			
			function jump_url(){
				if (document.getElementById('jump_url').style.display == ""){
					document.getElementById('jump_url').style.display = "none";
					document.getElementById('jump_id').style.display = "";
				}else{
					document.getElementById('jump_url').style.display = "";
					document.getElementById('jump_id').style.display = "none";
				}
			}
			</script>

            </td>
        </tr>
        <tr>
            <!--尾部--{-->
            <td colspan="3" class="mc-b"><#include "../foot.html"></td>
            <!--尾部--}-->
        </tr>
    </table>
<div class="msgClass">
                                                                    ${rsmsg!""}
                                                                </div>
    </body>
</html>
<#include "../jsPage.html">
